home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir24 / aprs60.zip / GPSTOHST.BAS < prev    next >
BASIC Source File  |  1993-11-19  |  1KB  |  38 lines

  1. PRINT "This program takes a RAW PROCOMM download file from a GPS receiver"
  2. PRINT "in NMEA-0183 format and formats it to look like an APRS packet beacon"
  3. PRINT "It looks for the GGA and VTG sentences."
  4. REM    For LORAN or other sentences GLL or RMC, you will have to rewrite
  5. REM    Several lines below...
  6. PRINT
  7. INPUT "Enter file name of raw GPS data"; FI$
  8. INPUT "Enter name of OUTPUT file for APRS packet beacons"; FO$
  9. INPUT "Enter callsign to be used with that data"; CALL$
  10. INPUT "Enter two digit DAY of data"; Day
  11. INPUT "Enter symbol for character (Car >, Air ', Boat ~)"; Sym$
  12. IF LEN(Sym$) <> 1 THEN Sym$ = ">"
  13. LET CALL$ = LEFT$(CALL$ + "         ", 10)
  14. OPEN FI$ FOR INPUT AS #1
  15. OPEN FO$ FOR OUTPUT AS #2
  16. DTG$ = MID$(DATE$, 4, 2) + LEFT$(TIME$, 2) + MID$(TIME$, 4, 2)
  17. DO WHILE NOT EOF(1)
  18. LINE INPUT #1, a$
  19. IF LEFT$(a$, 6) = "$GPGGA" AND MID$(a$, 36, 1) = "1" THEN
  20.    lat$ = MID$(a$, 15, 7)
  21.    lon$ = MID$(a$, 25, 8)
  22.    EST = VAL(MID$(a$, 8, 4)) - 500
  23.    IF EST < 0 THEN Tim = EST + 2400: Standby = 1 ELSE Tim = EST
  24.    IF EST > 0 AND Standby = 1 THEN Standby = 0: Day = Day + 1
  25.    UTC$ = RIGHT$("0" + MID$(STR$(Day), 2), 2) + RIGHT$("000" + MID$(STR$(Tim), 2), 4)
  26.    Pos$ = "/" + lat$ + "N/" + lon$ + "W"
  27.    END IF
  28. IF LEFT$(a$, 6) = "$GPVTG" THEN
  29.    CSE$ = Sym$ + MID$(a$, 8, 3)
  30.    SPD$ = "/" + MID$(a$, 26, 3)
  31.    END IF
  32. Pkt$ = CALL$ + UTC$ + " @" + UTC$ + Pos$ + CSE$ + SPD$ + "/comments"
  33. PRINT #2, Pkt$
  34. LOOP
  35. CLOSE
  36. END
  37.  
  38.